const path = require('path');
function resolve(dir) {
    return path.join(__dirname, dir)
}

module.exports = {
    chainWebpack: (config) => {
        // 配置路径别名
        config.resolve.alias
            .set('@', resolve('./src'))
            .set('assets', resolve('@/assets'))
            .set('api', resolve('@/api'))
            .set('components', resolve('@/components'))
            .set('views', resolve('@/views'));
    },
    lintOnSave:false,
    publicPath: '/',
    // 打包不生成.map文件
    productionSourceMap: false,
    devServer: {
        open: false,
        host: "localhost",
        port: 9091,
        https: false,
        proxy: {
            '/api': {
                // target: "http://192.168.1.4:9050",
                target: "localhost:9050",
                secure: false,
                changeOrigin: true,
                pathRewrite: {
                    '^/api': ''
                }
            }
        }
    }
}
